<?php

include("menu_element.php");

class MenuElementsListComponent extends Object{

	var $controller = true;
    var $elements_array;    
    var $num_elements;
 
    function MenuElementsListComponent(){
    	$this->clear();
    }
    
    function add($name, $action, $controllerName){
    	$this->elements_array[$this->num_elements] = new MenuElement($name, $action, $controllerName);
    	$this->num_elements++;
    }
    
    function remove($index){
    	//TODO
    }

    function clear(){
    	$this->elements_array = Array();    	
    	$this->num_elements = 0;
    }    
	
	function getSize(){
		return $this->num_elements;
	}
	
	function toArray(){
		return $this->elements_array;
	}
}

?>